<template>
  <div class="member">
    <top-bar backgroundColor="#2f2d35" iconColor="white">
      <template #title>
        <span class="white">
          {{ $t("Member benefits") }}
        </span>
      </template>
    </top-bar>
    <Card />
    <Tilte class="mb16">
      {{ $t("My benefits") }}
    </Tilte>
    <div class="mb24 pw16 x3">
      <div class="flex1 benefit" v-for="item in myBenefits" :key="item.name">
        <div class="benefit-icon">
          <img
            :src="require(`../../assets/images/vip/vip_icon${item.icon}.png`)"
          />
        </div>
        <div class="benefit-name">
          {{ $t(item.name) }}
        </div>
      </div>
    </div>
    <Tilte class="mb16">
      {{ $t("Next level of benefits") }}
    </Tilte>
    <div class="mb28 pw16 x3">
      <div class="flex1 benefit" v-for="item in nextBenefits" :key="item.name">
        <div class="benefit-icon">
          <img
            :src="require(`../../assets/images/vip/vip_icon${item.icon}.png`)"
          />
        </div>
        <div class="benefit-name">
          {{ $t(item.name) }}
        </div>
      </div>
    </div>
    <Upgrade />
  </div>
</template>

<script>
import TopBar from "../../components/TopBar/index.vue";
import Card from "./components/card.vue";
import Tilte from "./components/title.vue";
import Upgrade from "./components/upgrade.vue";
import { onMounted, reactive } from "vue";
export default {
  components: {
    TopBar,
    Card,
    Tilte,
    Upgrade,
  },
  setup() {
    const myBenefits = reactive([
      {
        icon: "1",
        name: "Newcomer reward",
      },
      {
        icon: "2",
        name: "Earn coins",
      },
      {
        icon: "3",
        name: "Invite friends",
      },
    ]);
    const nextBenefits = reactive([
      {
        icon: "4",
        name: "Priority withdrawal",
      },
      {
        icon: "5",
        name: "More coins",
      },
      {
        icon: "6",
        name: "Stay tuned",
      },
    ]);
    onMounted(()=>{
      window.trackEvent({pageTitle:'Memberpage',ev:'showMemberPage'})
    })
    return {
      myBenefits,
      nextBenefits,
    };
  },
};
</script>

<style lang="less" scoped>
@import "./class.less";
.member {
  background: #2f2d35;
  overflow: auto;
  height: 100%;
  margin-top: -1px;
  .white {
    color: #ffffff;
  }
  .pw16 {
    padding: 0 0.16rem;
  }
  .benefit {
    .y;
    .aic;
    &-icon {
      width: 0.48rem;
      height: 0.48rem;
      background: rgba(255, 255, 255, 0.07);
      border-radius: 50%;
      .x1;
      .aic;
      margin-bottom: 0.06rem;
      img {
        width: 0.28rem;
        height: 0.28rem;
      }
    }
    &-name {
      height: 0.2rem;
      font-size: 0.12rem;
      font-weight: 500;
      color: rgba(255, 255, 255, 0.54);
      .x1;
      .aic;
    }
  }
}
</style>
